using Furion;
using Furion.DatabaseAccessor;

using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;

namespace Abc.EntityFramework.Core
{
    [AppStartup(600)]
    public sealed class EntityFrameworkCoreStartup : AppStartup
    {
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddDatabaseAccessor(options =>
            {
                //options.AddDbPool<AbcDbContext>($"{DbProvider.MySql}@8.0.0");
                //options.AddDbPool<AbcDbContext>(DbProvider.SqlServer);
                options.AddDb<AbcDbContext>(DbProvider.Sqlite, optionBuilder: opt =>
                {
                    //opt.UseBatchEF_MSSQL();
                    //opt.UseBatchEF_MySQLPomelo();
                    //opt.UseBatchEF_Sqlite();
                });
            }, "Abc.Database.Migrations");
        }
    }
}